trace: fix security issues
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 2 Jul 2010 17:56:34 +0000 (18:56 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 2 Jul 2010 17:56:34 +0000 (18:56 +0100)
commitac9fb799479f3a6dc1fbb09482324d591452ce07
tree52f994dc113ffcdc58f54aac6282d1345b8283fa
parentd505477d647f79c99e93e61425e8310c54f800b2
trace: fix security issues

After getting a report of 3.2.3's xenmon crashing Xen (as it turned
out this was because c/s 17000 was backported to that tree without
also applying c/s 17515), I figured that the hypervisor shouldn't rely
on any specific state of the actual trace buffer (as it is shared
writable with Dom0)

[GWD: Volatile quantifiers have been taken out and moved to another
patch]

To make clear what purpose specific variables have and/or where they
got loaded from, the patch also changes the type of some of them to be
explicitly u32/s32, and removes pointless assertions (like checking an
unsigned variable to be >= 0).

I also took the prototype adjustment of __trace_var() as an
opportunity to simplify the TRACE_xD() macros. Similar simplification
could be done on the (quite numerous) direct callers of the function.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/common/trace.c
xen/include/xen/trace.h